//
//  MyContractEndTableViewCell.m
//  PropertyManager
//
//  Created by TNG on 2018/7/30.
//  Copyright © 2018年 Tng. All rights reserved.
//

#import "MyContractEndTableViewCell.h"

@implementation MyContractEndTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

-(instancetype) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self creatUI];
    }
    return self;
}

-(void)creatUI{
    [self.contentView addSubview:self.img];
    [self.contentView addSubview:self.titleLabel];
}

-(void)send
{
    self.img.backgroundColor = SFMRandColor;
    self.titleLabel.text = @"2019-09-08｜合同到期，已终止此合同";
}

-(UIImageView *)img
{
    if (_img == nil) {
        _img = [[UIImageView alloc] initWithFrame:CGRectMake(20, 17, 12, 12)];
        _img.contentMode = UIViewContentModeScaleAspectFill;
        _img.clipsToBounds = YES;
    }
    return _img;
}

-(UILabel *)titleLabel
{
    if (_titleLabel == nil) {
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(40, 13, WIDTH - 60, 20)];
        _titleLabel.font = font(12);
        _titleLabel.textColor = SFMColor(246, 110, 36);
        _titleLabel.textAlignment = NSTextAlignmentLeft;
    }
    return _titleLabel;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
